<%@ taglib uri="/WEB-INF/tlds/custom-html.tld" prefix="chtml" %>

<%@ page import="com.erp.app.common.ProjectConstants"%>
<%@ page import="com.erp.framework.util.CommonUtil" %>
<%@ page import="com.erp.framework.util.user.User" %>
<%@ page import="com.erp.app.common.ProjectConstants" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.erp.app.util.web.WebUtil" %>
<%@ page import="com.erp.framework.controller.form.SimpleBaseForm" %>
<%@ page import="com.erp.framework.SimpleConstants" %>

<%

String systemMode = WebUtil.getPrjParamVal(session, ProjectConstants.PP_SYSTEM_MODE);
String appVersion = WebUtil.getPrjParamVal(session, ProjectConstants.PP_APP_VERSION);

User user = (User)session.getAttribute(ProjectConstants.SESSION_USER);

String companyCode = CommonUtil.nullToString(user.getCompanyCode());
String dept = CommonUtil.nullToString(user.getDeptDesc());
String userName = CommonUtil.nullToString(user.getUserName());

SimpleBaseForm form = (SimpleBaseForm) pageContext.findAttribute(SimpleConstants.REQUEST_FROMBEAN_NAME);

String cgPwdLink = request.getContextPath() + "/changePassword.do";

%><!--<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0" class="cobrandingheader">
<tr> 
<td><img src="viewImage?name=<%=ProjectConstants.SERVLET_ATTRIB_KEY_COMPANIES_LOGO%>" border="0"></td>
</td>
</tr>
</table>
-->
<script language="javascript">
	function doLogout(url)
	{
<%--
		var t = (new Date()).getTime();
		
		var wide = window.screen.availWidth - 10;
		var height = window.screen.availHeight - 50;

		window.open(url,t,'left=0, top=0, width='+wide+',height='+height+',resizable=yes,menubar=yes,toolbar=yes,location=yes,scrollbars=auto,status=yes');

		document.forms[0].target = t;
		window.opener = null;
		window.close();
--%>
		window.location.href = url;
	}

	function doChangeLang() {
		
	}
</script>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="blackbar">
<tr class="blackbarrightlink">
<td width="1%" nowrap></td>
<td width="1%" nowrap><span class="blackbarleftlink">&nbsp;<a href="#"></a>&nbsp;&nbsp;</span></td>
<td class="verticalseparator" width="93%"></td>
<td width="1%" nowrap>Logged in as <span class="blackbaruserorg"><%=userName%></span> of <span class="blackbaruserorg"><%=companyCode%></span>, System Mode: <%=systemMode%>
<td class="verticalseparator" width="1%" nowrap>|</td>
<td width="1%" nowrap>Module ID: <%=form.getModuleName()%></td>
<td class="verticalseparator" width="1%" nowrap>|</td>
<td width="1%" nowrap><a href="#" onclick="javascript:window.open('<%=cgPwdLink%>' , 'wdis', 'toolbar=0,scrollbars=0,resizable=0,statusbar=0,menubar=0,width=640,height=400,top=0,left=0');return false;" class=logout_link>Change Password</a></td>
<td class="verticalseparator" width="1%" nowrap>|</td>
<td width="1%" nowrap><a href="javascript:doLogout('logout.do');">Logout</a></td>
</tr>
</table>